package com.zidian.leader.api;

import com.zidian.leader.entity.ColleagueEvaResult;
import com.zidian.leader.entity.ColleagueEvaTwoIndex;
import com.zidian.leader.entity.EvaluateRate;
import com.zidian.leader.entity.EvaluateRateCollege;
import com.zidian.leader.entity.HttpResult;
import com.zidian.leader.entity.LoginResult;
import com.zidian.leader.entity.NoDataResult;
import com.zidian.leader.entity.QuestionnaireDetail;
import com.zidian.leader.entity.StudentEvaSummary;
import com.zidian.leader.entity.StudentEvaTwoIndex;
import com.zidian.leader.entity.StudentStatistics;
import com.zidian.leader.entity.StudentStatisticsCollege;

import java.util.List;

import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import rx.Observable;

/**
 * Retrofit Service Interface
 * Created by GongCheng on 2016/11/2.
 */

public interface LeaderService {
    /**
     * 登录
     *
     * @param username 用户名
     * @param password 密码
     * @return observable
     */
    @FormUrlEncoded
    @POST("page/shiro/loginLead")
    Observable<LoginResult> login(
            @Field("username") String username,
            @Field("password") String password);

    /**
     * 获取学生统计(全校)
     *
     * @param leadId
     * @param college
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("page/leadStu/selectAssessNew")
    Observable<HttpResult<StudentStatistics>> getStudentStatistics(
            @Field("leadId") String leadId,
            @Field("college") String college,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 获取学生统计（院系）
     *
     * @param leadId
     * @param college
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("page/leadStu/selectAssessNew")
    Observable<HttpResult<List<StudentStatisticsCollege>>> getStudentStatisticsCollege(
            @Field("leadId") String leadId,
            @Field("college") String college,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 获取评教完成率（全校）
     *
     * @param collegeName
     * @param teacherId
     * @param studentMajor
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("page/leadStu/evaluatePercentageComplete")
    Observable<HttpResult<List<EvaluateRate>>> getEvaluateRate(
            @Field("studentMajor") String studentMajor,
            @Field("collegeName") String collegeName,
            @Field("teacherId") String teacherId,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 获取教评完成率（院系）
     *
     * @param collegeName
     * @param teacherId
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("page/leadStu/evaluatePercentageComplete")
    Observable<HttpResult<List<EvaluateRateCollege>>> getEvaluateRateCollege(
            @Field("studentMajor") String studentMajor,
            @Field("collegeName") String collegeName,
            @Field("teacherId") String teacherId,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 获取问卷详情
     *
     * @param teacherId
     * @param questionnaireExplain
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("leadership/questionnaireLeaderStatistics")
    Observable<HttpResult<List<QuestionnaireDetail>>> getQuestionnaireDetail(
            @Field("teacherId") String teacherId,
            @Field("questionnaireExplain") String questionnaireExplain,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 学生评价概要
     *
     * @param collegeName
     * @param teacherId
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("leadership/studentEvaluationProfile")
    Observable<HttpResult<List<StudentEvaSummary>>> getStudentEvaSummary(
            @Field("collegeName") String collegeName,
            @Field("teacherId") String teacherId,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 督导/同行评价概要
     *
     * @param statisticsType
     * @param collegeName
     * @param teacherId
     * @param roleId
     * @param token
     * @return
     */
    @SuppressWarnings("can't user now")
    @FormUrlEncoded
    @POST("leadership/studentEvaluationProfile")
    Observable<String> getColleagueEvaSummary(
            @Field("statisticsType") String statisticsType,
            @Field("collegeName") String collegeName,
            @Field("teacherId") String teacherId,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 测试接口
     */
    @FormUrlEncoded
    @POST("leadership/studentEvaluationProfile")
    Observable<ColleagueEvaResult> getColleagueEva(
            @Field("statisticsType") String statisticsType,
            @Field("collegeName") String collegeName,
            @Field("teacherId") String teacherId,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 学生评价二级标签
     *
     * @param collegeName
     * @param twoIndexName
     * @param teacherId
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("leadership/studentEvaluationTwoIndex")
    Observable<HttpResult<List<StudentEvaTwoIndex>>> getStudentEvaTwoIndex(
            @Field("collegeName") String collegeName,
            @Field("twoIndexName") String twoIndexName,
            @Field("teacherId") String teacherId,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 督导/教师评价二级标签
     *
     * @param collegeName
     * @param statisticsType
     * @param indexName
     * @param teacherId
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("leadership/teacherEvaluationTwoIndex")
    Observable<HttpResult<ColleagueEvaTwoIndex>> getColleagueEvaTwoIndex(
            @Field("collegeName") String collegeName,
            @Field("statisticsType") String statisticsType,
            @Field("indexName") String indexName,
            @Field("teacherId") String teacherId,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

    /**
     * 修改密码
     *
     * @param leadId
     * @param password
     * @param password1
     * @param password2
     * @param roleId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("page/leadStu/updatePassword")
    Observable<NoDataResult> changePassword(
            @Field("leadId") String leadId,
            @Field("password") String password,
            @Field("password1") String password1,
            @Field("password2") String password2,
            @Field("roleId") String roleId,
            @Field("token") String token
    );

}
